# Contributor: Daniel Santana <daniel@santana.tech>
# Maintainer: Daniel Santana <daniel@santana.tech>
pkgname=proot
pkgver=5.1.0_git20190306
_sha=a6db8746f21a2e68a8d0290a0aa9b3ad36d78f56 # contain musl fixes
pkgrel=1
pkgdesc="User-space implementation of chroot, mount --bind, and binfmt_misc"
url="https://proot-me.github.io"
arch="aarch64 armhf armv7 x86 x86_64"
license="GPL-2-or-later"
makedepends="bsd-compat-headers linux-headers libarchive-dev talloc-dev talloc-static"
subpackages="$pkgname-doc $pkgname-static"
source="$pkgname-$pkgver.tar.gz::https://github.com/proot-me/proot/archive/$_sha.tar.gz"
builddir="$srcdir/$pkgname-$_sha"
options="!check" # several tests are failing

build() {
	cd "$builddir"/src
	make proot proot.static
}

package() {
	install -Dm 0755 "$builddir"/src/proot "$pkgdir"/usr/bin/proot
	install -Dm 0644 "$builddir"/doc/proot/man.1 "$pkgdir"/usr/share/man/man1/proot.1
}

static() {
	install -Dm 0755 "$builddir"/src/proot.static "$subpkgdir"/usr/bin/proot.static
}

sha512sums="dacc32062b9648219ce009c5425c7b3350e96e109df7f64396bc1a04dfc07d043fd05cd362fc30b29a064e7dd3f8a4ab592a58328b8bea3ff40c6c1cc68451a1  proot-5.1.0_git20190306.tar.gz"
